//
// Created by Administrator on 2021/12/5.
//

#ifndef MARCHING_CUBES_DISPLAY_H
#define MARCHING_CUBES_DISPLAY_H

#include <cmath>
#include <GL/glut.h>
#include "MarchingCubes.h"

class Display {
    static Display *currentInstance;

    MarchingCubes *mc;

    static void display_callback() {
        currentInstance->display();
    }

    void setup_display_callback() {
        currentInstance = this;
        glutDisplayFunc(display_callback);  //显示图像
    }

    void display();

public:
    Display(MarchingCubes *mc, int argc, char **argv);

    void exec();
};


#endif //MARCHING_CUBES_DISPLAY_H
